package thread.test3Volatile;

/**
 */
public class ThreadLocalTest2 {

    public static void main(String[] args) throws InterruptedException {
        final ThreadLocal<Long> longLocal = new ThreadLocal<Long>();
        longLocal.set(1L);

        Thread thread1 = new Thread(){
            public void run() {
                longLocal.set(3L);
                System.out.println("bbb"+longLocal.get());
            };
        };
        thread1.start();
        thread1.join();
        System.out.println("aaa"+longLocal.get());

    }
}
